<template>
  <div>
    <h2>用户信息</h2>
    <p v-if="userData">姓名: {{ userData.name }}</p>
    <p v-if="userData">年龄: {{ userData.age }}</p>
    <p v-if="userData">Token: {{ userData.token }}</p>
	 <p v-if="userData">uid: {{ userData.uid }}</p>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  computed: {
    ...mapGetters(['getUserData']),
    userData() {
		console.log("计算属性触发"); // 调试用				
      return this.getUserData
    }
  },
  mounted() {
    console.log('从Vuex获取的数据:', this.userData)
  }
}
</script>